package com.hmall.order.Utils;

public class BaseContext {
    private static final ThreadLocal<Long> THREAD_LOCAL = new ThreadLocal<>();

    /**+
     * 保存当前登录用户id
     * @param id    传入用户id
     */
    public static void setCurrentId(Long id){
        THREAD_LOCAL.set(id);
    }

    /**
     * 获取id
     * @return
     */
    public static Long getCurrentId(){
        return THREAD_LOCAL.get();
    }

}

